{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">编辑员工</h3>
	<table class="layui-table layui-table-form">
		<tr><td class="layui-td-gray-2">姓名<font>*</font></td>
			<td><input type="text" name="real_name"  lay-verify="required" lay-reqText="请完善姓名" value="{$detail.real_name}" autocomplete="off" placeholder="请输入姓名" class="layui-input"></td><td class="layui-td-gray-2">类别<font>*</font></td>
			<td>
				<select name="status"  lay-verify="required" lay-reqText="请完善类别">
					<option value="">请选择</option>
					<option value="员工" {eq name="$detail.status" value="员工"} selected{/eq}>员工</option>
					<option value="嘉宾" {eq name="$detail.status" value="嘉宾"} selected{/eq}>嘉宾</option>
				</select>
			</td><td class="layui-td-gray-2">部门<font>*</font></td>
			<td>
				<select name="department"  lay-verify="required" lay-reqText="请完善部门">
					<option value="">请选择</option>
					<option value="小学部" {eq name="$detail.department" value="小学部"} selected{/eq}>小学部</option>
					<option value="初中部" {eq name="$detail.department" value="初中部"} selected{/eq}>初中部</option>
					<option value="高中部" {eq name="$detail.department" value="高中部"} selected{/eq}>高中部</option>
					<option value="行政后勤" {eq name="$detail.department" value="行政后勤"} selected{/eq}>行政后勤</option>
					<option value="退休教师" {eq name="$detail.department" value="退休教师"} selected{/eq}>退休教师</option>
				</select>
			</td>
		</tr>
				<tr><td class="layui-td-gray-2">是否签到<font>*</font></td>
			<td>{eq name="$detail.signed" value="1"}是{/eq}
			{eq name="$detail.signed" value="0"}否{/eq}</td><td class="layui-td-gray-2">抽奖结果</td>
			<td><input type="text" name="level"   lay-reqText="请完善抽奖结果" value="{$detail.level}" autocomplete="off" placeholder="请输入抽奖结果" class="layui-input" disabled></td><td colspan='2' >签到与抽奖结果不可修改，可点击列表后的手动签到</td>
		</tr>
	</table>
	<div class="py-3">
		<input type="hidden" name="id" value="{$detail.id}"/>
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	var moduleInit = ['tool'];

	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		
		
				
		//监听提交
		form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/lottery_staff/edit", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->